import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;


public class SelectionBox implements IDrawingObject{

	Color myColor;
	Point p1,p2;
	DrawingCanvas canvas;
	boolean active;
	
	public SelectionBox(DrawingCanvas c){
		myColor=Color.yellow;
		canvas=c;
	}
	
	public void drawMe(Graphics g) {
		if(active){
			Color tempColor = g.getColor();
			g.setColor(myColor);
			g.drawRect(Math.min(p1.x,p2.x), Math.min(p1.y,p2.y), Math.abs(p1.x-p2.x), Math.abs(p1.y-p2.y));
			g.setColor(tempColor);
		}
	}

	public int getHeight() {
		return Math.abs(p1.y-p2.y);
	}

	public int getTop() {
		return Math.min(p1.y,p2.y);
	}

	public int getWidth() {
		return Math.abs(p1.x-p2.x);
	}
	
	public int getLeft(){
		return Math.min(p1.x,p2.x);
	}

	public boolean isPointInObject(Point p) {
		return false;
	}
	public void setmycolor(Color c){
	}
}
